package com.my.serviceimpl;

import com.my.bean.BabyNursing;
import com.my.bean.KitchenArrange;
import com.my.bean.ResultPage;
import com.my.bean.VoPage;
import com.my.mapper.KitchenArrangeMapper;
import com.my.service.KitchenArrangeService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 厨房每日工作安排 服务实现类
 * </p>
 *
 * @author 闫亚茹
 * @since 2018-08-28
 */
@Service
public class KitchenArrangeServiceImpl extends ServiceImpl<KitchenArrangeMapper, KitchenArrange> implements KitchenArrangeService {


    @Override
    public ResultPage<KitchenArrange> selectMyPage(VoPage voPage) {
            Map<String, Object> paramMap = new HashMap<String, Object>();
            paramMap.put("page", (voPage.getPage() - 1)*voPage.getLimit());
            paramMap.put("limit", voPage.getLimit());
            List<KitchenArrange> list = baseMapper.selectKitchen(paramMap);
            Integer count = baseMapper.countMyPage(paramMap);
            ResultPage<KitchenArrange> resultPage=new ResultPage<>();
            resultPage.setCode(0);
            resultPage.setCount(count);
            resultPage.setMsg("成功");
            resultPage.setData(list);
            return resultPage;
    }

    @Override
    public List<KitchenArrange> selectKitchen() {
        return null;
    }

}
